package com.duobao.uitl;

import com.duobao.server.NPC;
import com.duobao.server.WuGong;

public class Formula {
    private Formula()
    {

    }
    public static int chushouZh(NPC npc,WuGong wg,int zhaoshi)//出手综合
    {
        int chuZHe1=npc.getZH()[wg.getCategory2()-1];

        Float f=((float)zhaoshi/(float)wg.getTezhaoshu())/2;
        float xiuweixshu=(float) Math.sqrt(Math.sqrt(Math.sqrt(npc.getCultivationN())));
        chuZHe1=(int)((xiuweixshu==0?1:xiuweixshu)*chuZHe1*(Float)(wg.getXishu()*(1+f)));
        return chuZHe1;
    }
    public static int zhaojiaZh(NPC npc,WuGong wg,int zhaoshi)//招架综合
    {
        int chuZHe1=npc.getZH()[8];

        Float f=((float)zhaoshi/(float)wg.getTezhaoshu())/2;
        float xiuweixshu=(float) Math.sqrt(Math.sqrt(Math.sqrt(npc.getCultivationN())));
        chuZHe1=(int)((xiuweixshu==0?1:xiuweixshu)*chuZHe1*(Float)(wg.getXishu()*(1+f)));
        return chuZHe1;
    }
    public static int duobaiZh(NPC npc,WuGong wg,int zhaoshi)//躲避综合
    {
        int chuZHe1=npc.getZH()[7];
        Float fff=(float)(npc.getSDuo())/100;//设置鞋
        Float f=((float)zhaoshi/(float)wg.getTezhaoshu())/2;
        float xiuweixshu=(float) Math.sqrt(Math.sqrt(Math.sqrt(npc.getCultivationN())));
        chuZHe1=(int)((1+fff)*(xiuweixshu==0?1:xiuweixshu)*chuZHe1*(Float)(wg.getXishu()*(1+f)));

        return chuZHe1;
    }
    public static int taopaoZh(NPC npc)//逃跑综合
    {
        WuGong duo=npc.duobiWugong();//出手武功
        int chuZHe1=npc.getZH()[7];


        float xiuweixshu=(float) Math.sqrt(Math.sqrt(Math.sqrt(npc.getCultivationN())));
        chuZHe1=(int)((xiuweixshu==0?1:xiuweixshu)*chuZHe1*(Float)(duo.getXishu()));

        return chuZHe1;
    }
    public static int shanghaiZh(NPC npc1,NPC npc2,int chushouZH)//npc1伤害npc2综合
    {
        Float fff=(float)(npc1.getSHai()-npc2.getFYu())/100;

        int zhshai=20+(int)(chushouZH*(1+fff));


        return zhshai;
    }
    public static Float houdexiuwei(NPC npc) {//获得修为

        Float xiuwei=(float)(Math.sqrt(npc.getCultivationN()+(npc.getCultivationY()/250f)+(npc.getCultivationR()/12f)))/30.0f;
        return xiuwei;
    }
public static Float diushixiuwei(NPC npc) {//丢失修为

        Float xiuwei=(float)(Math.sqrt(npc.getCultivationN()+(npc.getCultivationY()/250f)+(npc.getCultivationR()/12f)))/10.0f;
        return xiuwei;
    }
}
